﻿@using X.PagedList;
@using X.PagedList.Mvc.Core;
@using X.PagedList.Mvc.Common;
@using FwProject.Settlement.Dto
@model IPagedList<SettlementInfoPrePaymentInfo>
@{
    Layout = null;
    int i = 0;
    if (Model.Count > 0)
    {
        if (Model.PageNumber != 1)
        {

            i = (Model.PageNumber - 1) * Model.PageSize;
        }
    }
    decimal Sumprice = 0;
}
<div style="max-height:600px;overflow-y:scroll;" id="table_print">

    <table class="table table-bordered table-hover table-rowselected">
        <thead>
            <tr>
                <th style="width:45px">序号</th>
                <th>收款人</th>
                <th>收款笔数</th>
                <th>任务数</th>
                <th>收款金额</th>
            </tr>
        </thead>
        <tbody>
            @if (Model.Count == 0)
            {
                <tr><td colspan="5" align="center">暂无数据</td></tr>
            }
            else
            {
                foreach (var item in Model)
                {
                    Sumprice += item.Actualprice;
                    i++;
                    <tr>
                        <td>@i</td>
                        <td><a href="javascript:top.window.openTab(4567,'收款详情[@item.Name]','/Payment/ReceiptDetail?id=@item.UserId')">@item.Name</a></td>
                        <td>@item.MarkCount</td>
                        <td>@item.TaskCount</td>
                        <td>@item.Actualprice</td>
                    </tr>
                }
                <tr class="footer">
                    <td>合计</td>
                    <td colspan="3"></td>
                    <td>@Sumprice</td>
                </tr>
            }
        </tbody>
    </table>
</div>
<div class="row pagedinfo">
    <div class="col-sm-5">
        @*共 @Model.TotalItemCount 条，@Model.PageSize 条/页 当前第 @Model.PageNumber/@Model.PageCount 页*@
        共 @Model.TotalItemCount 条，
        <select class="form-control" id="pageSize" style="width:70px;display:initial">
            @for (int z = 10; z < 100; z = z + 10)
            {
                if (z == Model.PageSize)
                {
                    <option selected value="@z">@z</option>
                }
                else
                {
                    <option value="@z">@z</option>
                }
            }
        </select> &nbsp;条/页 当前第 @Model.PageNumber/@Model.PageCount 页
    </div>
    <div class="col-sm-7">
        <input type="hidden" id="pageurl" value="&likename=@(Context.Request.Query["likename"])&AgentPeoperUserId=@(Context.Request.Query["AgentPeoperUserId"])" />
        @Html.PagedListPager(Model, page => Url.Action("PaymentIndex", new { pageIdx = page, size = Context.Request.Query["size"], likename = Context.Request.Query["likename"], AgentPeoperUserId = Context.Request.Query["AgentPeoperUserId"] }), PagedListRenderOptions.EnableUnobtrusiveAjaxReplacing(new AjaxOptions() { AllowCache = false, HttpMethod = "Get", UpdateTargetId = "data_list", OnSuccess = "AjaxSuccessCallback", OnBegin = "AjaxBegin" }))
    </div>
</div>


